﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GIMS.MODEL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.IDAL;
using KPIS.GERP.GIMS.DALFactory;

namespace KPIS.GERP.GIMS.BLL
{
    public class ResourceMasterItemBLL : IBLLResourceMasterItem
    {
        private static readonly IDALResourceMasterItem dal = DataAccess.CreateResourceMasterItem();

        public ResourceMasterItemBLL()
        {

        }

        public IList<ResourceMasterItemInfo> GetResourceMasterItem()
        {
            return dal.GetResourceMasterItem();
        }

        public IList<ResourceMasterItemInfo> GetResourceMasterItem(string record_status)
        {
            return dal.GetResourceMasterItem(record_status);
        }

        public ResourceMasterItemInfo GetResourceMasterItem(int seq)
        {
            return dal.GetResourceMasterItem(seq);
        }

        public IList<ResourceMasterItemInfo> GetResourceMasterItemWithParent(int sub_group_seq)
        {
            return dal.GetResourceMasterItemWithParent(sub_group_seq);
        }

        public IList<ResourceMasterItemInfo> GetResourceMasterItem(Nullable<int> Sequence, Nullable<int> ResourceType, string SearchText)
        {
            return dal.GetResourceMasterItem(Sequence, ResourceType, SearchText);
        }

        public void Insert(ResourceMasterItemInfo info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Update(ResourceMasterItemInfo info, string change_file)
        {
            try
            {
                dal.Update(info, change_file);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(ResourceMasterItemInfo info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteAll(IList<ResourceMasterItemInfo> infoList)
        {
            try
            {
                dal.DeleteAll(infoList);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteFromDB(IList<ResourceMasterItemInfo> infoList)
        {
            try
            {
                dal.DeleteFromDB(infoList);
            }
            catch
            {
                throw;
            }
        }

        public void Restore(IList<ResourceMasterItemInfo> infoList)
        {
            try
            {
                dal.Restore(infoList);
            }
            catch
            {
                throw;
            }
        }
    }
}
